package com.xuecheng.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xuecheng.system.model.po.Dictionary;
import org.springframework.stereotype.Service;
import com.xuecheng.system.mapper.DictionaryMapper;
import com.xuecheng.system.service.DictionaryService;
import org.springframework.util.StringUtils;

@Service
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Dictionary>
    implements DictionaryService {
    @Override
    public Dictionary getByCode(String code) {
        return getOne(new LambdaQueryWrapper<Dictionary>()
                .eq(StringUtils.hasText(code),Dictionary::getCode,code));
    }
}
